﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AMicroblogAPI;
using AMicroblogAPI.Common;

public partial class SignInSina : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        var requestToken = AMicroblog.GetRequestToken();

        Session["RequestToken"] = requestToken;

        //TODO: Gets the baseSiteUri.
        var callbackUrl = HttpUtility.UrlEncode("http://localhost:32106/BaFang/SignInSinaCallback.aspx");

        Response.Redirect(string.Format("{0}?oauth_token={1}&oauth_callback={2}", APIUri.Authorize, requestToken.Token, callbackUrl));
    }
}